<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="rows" placeholder="行数">
    <input type="text" id="cols" placeholder="列数">
    <button id="btn">提交</button>
    <div id="res"></div>
    <script>
        var rows = document.getElementById("rows");
        var cols = document.getElementById("cols");
        var btn = document.getElementById("btn");
        btn.onclick = function () {
            var str = "" ;
            var str1 = "*" ;   
            var a = parseInt(rows.value);
            var b = parseInt(cols.value);
            for ( var i = 0 ; i < a ; i ++ ){
                for ( var j = 0 ; j < b ; j ++ ) {
                    str = str + str1 ;
                }
                str = str + "</br>" ;
            }
            document.getElementById("res").innerHTML = str ;
        }
    </script>
</body>
</html>